<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<head> 
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
	<title>湖南省自来水公司营销管理信息系统</title> 
	
	<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/text.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/form.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/buttons.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/grid.css" type="text/css" media="screen" title="no title" />	
	<link rel="stylesheet" href="../css/layout.css" type="text/css" media="screen" title="no title" />	
	
	<link rel="stylesheet" href="../css/ui-darkness/jquery-ui-1.8.12.custom.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/jquery.visualize.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/facebox.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/uniform.default.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/dataTables.css" type="text/css" media="screen" title="no title" />
	
	<link rel="stylesheet" href="../css/custom.css" type="text/css" media="screen" title="no title">
	<script src="/webjars/vue/2.5.17/dist/vue.js"></script>
	<script src="../layui/layui.all.js"></script>
	<style type="text/css">
	table.data thead th { vertical-align:middle; text-align:center; }
	</style>
</head> 
 
<body> 

<div id="wrapper">

	<div id="bool"><script>window.onload=function (){  $("#bool").load("../ming.html");}</script></div>

	
	<div id="content" class="xgrid" >

		<div class="x12">
			
			<h2>
				抄表复核 - 按用户复核
				<div style="float:right;">
					<a href="rd_audit.html">按表册复核</a>
					按用户复核
				</div>
			</h2>

			<div class="searchUserDiv">
				用户编码 <input size="16" v-model="usUser.userno"/>
				用户简码 <input size="16" v-model="usUser.abc"/>
				用户姓名 <input size="16" v-model="usUser.username"/>
				联系电话 <input size="16" v-model="usUser.smsphone"/>
				家庭住址<input size="16" v-model="usUser.address"/>
				<button class="btn btn-small btn-icon btn-person" @click="findUser();"><span></span>查询用户</button>
			</div>
			
			
			<div style="float:right;">
				<button class="btn-icon btn-blue btn-check" @Click="show1();"><span></span>复核选中的所有记录</button>
			</div>
			&nbsp;<br/><br/>
			<script>

				function checkAll() {
					content.checkbox=[];
					var all=document.getElementById('all');//获取到点击全选的那个复选框的id
					var one=document.getElementsByName('checkname[]');//获取到复选框的名称
					if(all.checked==true){//因为获得的是数组，所以要循环 为每一个checked赋值
						for(var i=0;i<one.length;i++){
							one[i].checked=true;
							content.checkbox.push(one[i].value);
						}
					}else{
						for(var j=0;j<one.length;j++){
							one[j].checked=false;
							content.checkbox=[];
						}

					}

				}

			</script>
			
			<table class="data display">
					<thead>
						<tr>
							<th><input type="checkbox" id="all" onClick="checkAll();"></th>
							<th>年份</th>
							<th>月份</th>
							<th>第几次<br/>抄表</th>
							<th>用户编码</th>
							<th>用户姓名</th>
							<th>上次底码</th>
							<th>本次底码</th>
							<th>用水量</th>
							<th>性质</th>
							<th>&nbsp;</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd" v-for="r in read" v-if="read!=null"> <!-- 查询到了数据 -->
							<td class="center"><input type="checkbox" name="checkname[]" :value="r.ID" class="chk" v-model="checkbox"></td>
							<td class="center" >{{r.ReadYear}}</td>
							<td class="center" v-text="r.ReadMonth">加载中...</td>
							<td class="center" >1</td>
							<td class="center" v-text="r.UserNo">加载中...</td>
							<td class="center" v-text="r.UserName">加载中...</td>
							<td class="right" v-text="r.PreValue">加载中...</td>
							<td class="right" v-text="r.CurValue">加载中...</td>
							<td class="right" v-text="r.Amount">加载中...</td>
							<td class="center">每月抄表任务</td>
							<td class="center">
								<button class="btn-icon btn-small btn-blue btn-check" @Click="show2(r.ID);"><span></span>复核</button>
							</td>
						</tr>
						<tr class="odd" v-if="User==''"> <!-- 查询不到数据 -->
							<td class="center" colspan="11">
								<span id="htmlvalue" style="align-content: center">请先查询数据</span>
							</td>
						</tr>
						</tbody>
					</table>
			
		</div> <!-- .x12 -->
		
	</div> <!-- #content -->
	<script>
		//回调用户编号
		function callback1(id) {
			content.User=id;
			content.queryBYid(id);
			alert(JSON.stringify(content.User))
		}

		var $ = layui.jquery,
				layer = layui.layer,
				form = layui.form;
		table = layui.table;
		var content = new Vue({
			el: "#content",
			data: {
				User:'',
				usUser: {//用户信息
					userno: '',
					username: '',
					abc: '',
					address: '',
					smsphone: ''
				},
				read:'',
				checkbox:[],
			},
			methods:{
				queryBYid(id){
					$.ajax({
						type: 'GET',
						url: "/rd-read/queryAuditByUserNo",
						data: {"UserNo": id},
						dataType: 'JSON',
						success: function (json) {
							alert(json.code)
							if (json.code == 1) {
								$("#htmlvalue").html(json.message);
								layer.msg(json.message);
							} else {
								//content.User.userno='';

								content.read = json.data.list;
								alert(JSON.stringify((content.read)))

							}
						}
					});
				},
				//查询用户信息
				findUser() {
					var index = layer.open({
						content: 'sys_selectUser.html?Userno=' +
								'' + content.usUser.userno + '&UserName=' + content.usUser.username + '' +
								'&abc=' + content.usUser.abc +
								'&smsphone=' + content.usUser.smsphone + '&Address=' + content.usUser.address,
						area: ['70%', '80%'],
						resize: false,
						shadeClose: true,
						type: 2,
						btn: ["关闭"],
						scrollbar: false,
					});
				},
				show1(){
					alert(content.checkbox.length);
					var value=1;
					var w = ($(window).width() * 0.7);
					var h = ($(window).height() - 50);
					var str="";
					layer.open({
						resize: false,
						title: '预览',
						shadeClose: true,
						area: [w + 'px', h + 'px'],
						type: 2,
						content: 'rd_audit_progress.html?length='+content.checkbox.length,
						btn: ['关闭'],
						// yes: function (index, obj) {
						// 	///当点击‘确定’按钮的时候，获取弹出层返回的值
						// 	var res = window["layui-layer-iframe" + index].show();
						// 	//打印返回的值，看是否有我们想返回的值。
						// 	alert(res);
						// 	//     console.log(res);
						// 	//最后关闭弹出层
						// 	layer.close(index);
						// },
						success: function (layero, index) {
							var body = layer.getChildFrame('body', index);
							str = body.find('button').html();
						}
					});

				},
				show2(id) {
					content.id=id;
					var value = 1;
					var w = ($(window).width() * 0.7);
					var h = ($(window).height() - 50);
					var str = "";
					layer.open({
						resize: false,
						title: '预览',
						shadeClose: true,
						area: [w + 'px', h + 'px'],
						type: 2,
						content: 'rd_audit_progress1.html',
						btn: ['关闭'],
						// yes: function (index, obj) {
						// 	///当点击‘确定’按钮的时候，获取弹出层返回的值
						// 	var res = window["layui-layer-iframe" + index].show();
						// 	//打印返回的值，看是否有我们想返回的值。
						// 	alert(res);
						// 	//     console.log(res);
						// 	//最后关闭弹出层
						// 	layer.close(index);
						// },
						success: function (layero, index) {
							var body = layer.getChildFrame('body', index);
							str = body.find('button').html();
						}
					});
				},
				addPy(){
					$.post("/rd-read/addpy",{"Id":content.checkbox.toString(),"volumeId":content.volumeId},function (date) {
						content.read=date;
					})
				},
				addPyById(){
					$.post("/rd-read/addpy",{"Id":content.id.toString(),"volumeId":content.volumeId},function (date) {
						content.read=date;
					})
				}
			}
			})
	</script>
	
	<div id="footer">		
		<div class="content_pad">			
			<p>&copy; 2013-11 版权所有 <a href="#">湖南省自来水公司</a>.   技术支持 <a href="#">职业教育</a>.</p>
		</div> <!-- .content_pad -->
	</div> <!-- #footer -->
	
</div> <!-- #wrapper -->

<script src="../js/jquery/jquery-1.5.2.min.js"></script>a
<script src="../js/jquery/jquery-ui-1.8.12.custom.min.js"></script>
<script src="../js/misc/excanvas.min.js"></script>
<script src="../js/jquery/facebox.js"></script>
<script src="../js/jquery/jquery.visualize.js"></script>
<script src="../js/jquery/jquery.dataTables.min.js"></script>
<script src="../js/jquery/jquery.tablesorter.min.js"></script>
<script src="../js/jquery/jquery.uniform.min.js"></script>
<script src="../js/jquery/jquery.placeholder.min.js"></script>

<script src="../js/widgets.js"></script>
<script src="../js/dashboard.js"></script>

<script type="text/javascript">
	
$(document).ready ( function () 
{
	Dashboard.init ();
	
});

//审核操作
function auditMutil(){
	showWindow({url:'../page/rd_audit_progress.html',width:560,height:240});
}
function audit(){
	showWindow({url:'../page/rd_audit_progress1.html',width:560,height:240});
}

</script>

</body> 
 
</html>